home *** CD-ROM | disk | FTP | other *** search
/ SunSoft Catalyst CDWARE 1996 May to August / Catalyst CDWARE 1996 May to August.iso / .products / .bin / httpd / Solaris_2 / checklinks.pl < prev    next >
Perl Script  |  1996-02-15  |  4KB  |  154 lines

  1. #!./perl
  2.  
  3. # ------------------------------------------------------------
  4.  
  5. # initdev.pl, by Jean-Pierre Girard (jpg@corrado.sun.com)
  6. # This allows the development environment to choose what
  7. # page to load depending on the existence of .cdev
  8.  
  9. # ------------------------------------------------------------
  10.  
  11. # Bugs and other fixes
  12.  
  13. # ------------------------------------------------------------
  14. ##############################################################################
  15. # CompressFiles: tar the insertion files and compress them
  16. ##############################################################################
  17. sub CompressFiles
  18. {
  19.     $res =  `tar cvf $TARFILE $HomeDir`;
  20.     $res =~ s/\n/<br>/g;
  21.     print $res;
  22.     $res =  `compress $TARFILE; ls -l $TARFILE.Z`;
  23.     $res =~ s/\n/<br>/g;
  24.     print $res;
  25. }
  26.  
  27. ##############################################################################
  28. # main
  29. ##############################################################################
  30. $BASEDIR = $ENV{"DOCUMENT_ROOT"};
  31. require 'devinfo.pl';
  32. require 'tools.pl';
  33.  
  34. if ($ENV{'REQUEST_METHOD'} eq "POST") {
  35.     read(STDIN, $request, $ENV{'CONTENT_LENGTH'});
  36. } elsif ($ENV{'REQUEST_METHOD'} eq "GET" ) {
  37.     $request = $ENV{'QUERY_STRING'};
  38. }
  39.  
  40. $HomeDir = &GetDevinfo("dir");
  41. $TARFILE = $HomeDir . "/../cdware.tar";
  42.  
  43. $~ = HEADER;
  44. write;
  45.  
  46. $request =~ s/%(..)/pack("c",hex($1))/ge;
  47. print "request=$request<br>";
  48. print "ARGV0=$ARGV[0]<br>";
  49. #if (@ARGV == 0 && $request eq "") {
  50.  
  51.  
  52. if ($ARGV[0] ne "") {
  53.     &CompressFiles();
  54.     if ($ARGV[0] eq "FTP") {
  55.         print "in case argv=ftp";
  56.     } elsif ($ARGV[0] eq "TAPE") {
  57.         print "in tape<br>";
  58.     } elsif ($ARGV[0] eq "DISKETTE") {
  59.         print "in disk<br>";
  60.         #&CreateDefaultIndex();
  61.     }
  62. } else {
  63.     unless (-s $HomeDir . "/index.html") {
  64.         &PrintErr("NoExist", "$HomeDir/index.html");
  65.     }
  66.     print "<h2>checks the file names</h2>";
  67. }
  68.  
  69.  
  70.     #$~ = MIDDLE;
  71.     #write;
  72.  
  73.     $~ = FOOTER;
  74.     write;
  75.  
  76.  
  77. ##############################################################################
  78. # formats
  79. ##############################################################################
  80. format HEADER =
  81. Content-type: text/html
  82.  
  83.  
  84. <html>
  85. <title>Catalyst CDware - Development environment</title>
  86. <body>
  87. <h1>CDware Development environment</h1>
  88. <h4>Currently working with "@*
  89. $HomeDir
  90. "</h4>
  91. <h2>Are you sure you are done with your insertion?</h2>
  92. <ol type=1>
  93. .
  94.  
  95. format MIDDLE =
  96. <li><a href="http://localhost:7999/cgi-bin/edit_info.pl?HTML">Edit _info(perl)</a><br>
  97. <li><a href="@*"
  98. "file://" . $HomeDir . "/index.html"
  99. >Test your insertion</a>
  100. .
  101.  
  102. format FOOTER =
  103. </ol>
  104. <p>
  105. <hr>
  106. <p>
  107. You, like these companies, will benefit from the CDware capability of reaching tens of thousands of potential customers with information, links to your web site, or directly with YOUR product!
  108. <p><app class=ImageTape width=596 height=65 img_dir=../../../DEV/logos speed=10 dir=-10
  109. url1=oracle
  110. url2=progress
  111. url3=gupta
  112. url4=informix
  113. url5=lotus
  114. url6=ingres
  115. >
  116. </b>
  117. <h5><p><A HREF=file:///tmp/httpd/.products/CDware/Help/SMICopyright.html>Copyright</A> 1995 Sun Microsystems, Inc., 2550 Garcia Ave., Mtn. View, CA 94043 USA.  All rights reserved.</h5><br></pre>
  118. <a href=file:///tmp/httpd/.products/DEV/credits.html>Credits</a>
  119. </b>
  120. </form>
  121. </body>
  122. </html>
  123. .
  124.  
  125. format INDEX_DEFAULT =
  126. <html>
  127. <title>CDware - @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< </title>
  128. $Company
  129. <body>
  130. <h1>@*
  131. $Company
  132. </h1><p>@*
  133. $Description
  134. <h4>@*
  135. $Product
  136. "</h4>
  137. <hr>
  138. @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  139. $Company
  140. <br>???? XXXXXXXXXXXXX XXXXXXXXX<br>
  141. XXXXXXXXXXXX, XX 99999<br>
  142. <h5>To contact our sales services or ask for more information:<A HREF="mailto:@*
  143. $Email
  144. ">@*
  145. $Email
  146. </A></H5>
  147. <h5>To visit our web site:<A HREF="http://@*
  148. $WebSite
  149. ">@*
  150. $WebSite
  151. </A></H5>
  152. <body><html>
  153. .
  154.